//
//  YWAliyunOSSManager.h
//  maintain
//
//  Created by 郑想 on 15/10/30.
//  Copyright © 2015年 ewin. All rights reserved.
//

#import "YWSingleton.h"
#import <Foundation/Foundation.h>
@class OSSGetObjectRequest;

@interface YWAliyunOSSManager : NSObject
YWSingletonH(Manager)

    /**
 *  获取oss保存地址
 *
 *  @param fileName 文件名
 *
 *  @return 保存地址
 */
    - (NSString*)ossSaveFilePath : (NSString*)fileName;
/**
 *  获取oss头像保存地址
 *
 *  @param fileName 头像文件名
 *
 *  @return 保存地址
 */
- (NSString*)ossSaveAvatarFilePath:(NSString*)fileName;
/**
 *  上传图片
 *
 *  @param filePath 图片路径
 *
 *  @return 上传结果
 */
- (BOOL)uploadPictureSyncWithFilePath:(NSString*)filePath isAvatar:(BOOL)isAvatar;

- (void)downloadFile:(NSString*)objectKey completeBlock:(void (^)(NSData* data))completeBlock;
- (void)downloadFile:(NSString*)objectKey toFilePath:(NSString*)path progressBlock:(void (^)(float progress))progressBlock completeBlock:(void (^)(BOOL success))completeBlock;
-(void)cancelTaskWithRequest:(OSSGetObjectRequest*)OSSGetObjectRequest;
@end
